<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>fileList</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <link rel="stylesheet" type="text/css" th:href="@{/webjars/bootstrap/4.1.0/css/bootstrap.css}" />
    <script type="text/javascript" th:src="@{/webjars/jquery/3.0.0/jquery.js}"></script>
    <script type="text/javascript" th:src="@{/webjars/bootstrap/4.1.0/js/bootstrap.js}"></script>
</head>
<body>
    <div class="btn-toolbar" role="toolbar">
        <span th:each="fileName:${files}" class="btn-group">
            <button class="btn btn-primary btn-modify" th:text="${fileName}"
                  onclick="attach(event)"
                    data-toggle="tooltip" data-placement="bottom" th:title="'下载'+${fileName}+',netBeans打开前要解压'"></button></span>
    </div>
    <div style="background-color: bisque">
        <form enctype="multipart/form-data" action="/upload" method="post">
        <label for="file">上传文件小于1M</label>
        <input id="file" type="file" name="file">
            <button type="submit" class="btn btn-secondary">提交上传</button>
        </form>
        <span th:text="${uploadResult}"></span>
    </div>
    <div style="background-color: burlywood">
        <button onclick="accessCount()">服务器总访问量</button>
        <h2 id="count" style="height: 30px"></h2>
    </div>
    <!--<div style="background-color:darkkhaki">-->
        <!---->
        <!--<button type="button" id="jButton" onclick="enter()">JWebUnit</button>-->
    <!--</div>-->
    <code style="background-color: black">请求制作模板<br>
        $.ajax({<br>
        type: 'put',<br>
        url: url,<br>
        contentType: 'application/json',<br>
        data: JSON.stringify(dataToSend),<br>
        dataType: 'json',<br>
        success:function(data){}<br>
        })<br>
    </code>
    <script>

        $(function () { $("[data-toggle='tooltip']").tooltip(); });
        var enter = function (e) {

        };
        var attach = function (e) {
            window.open("/download/"+e.target.innerText);
        };
        var debug1;
        var accessCount = function () {
            $.ajax({
                url:'/totalReqNum',
                type:'get',
                //contentType:'',
                //data:,
                dataType:'text',
                success:function (data) {
                    $("#count").html(data);

                }
            })

        }
    </script>
    <style type="text/css">
        body {background-color: grey}
        .btn-modify{
            margin: 4px;
        }
    </style>
</body>
</html>